// 工单管理 相关接口
import service from '@/utils/request'
import constant from '@/utils/constant'
import Qs from 'qs'

const root = (process.env.NODE_ENV === 'development' ? '/api' : '')

// 查询评检组以及评检项
const getCheckGroupAndItem = (data) => {
  return service({
    url: root + constant.getCheckGroupAndItem,
    method: 'get',
    data: data
  })
}

// 查询当前用户的下级用户
const getLowerUserofCurrentUser = (data) => {
  return service({
    url: root + constant.getLowerUserofCurrentUser,
    method: 'get',
    data: data
  })
}

// 删除巡检任务
const removePatrolTask = (data) => {
  return service({
    url: root + constant.removePatrolTask,
    method: 'delete',
    data: data
  })
}

// 查询定时任务列表
const listPatrolTask = (data) => {
  return service({
    url: root + constant.listPatrolTask,
    method: 'get',
    params: data
  })
}

// 查询巡店任务网点
const listPatrolTaskPoint = (data) => {
  return service({
    url: root + constant.listPatrolTaskPoint,
    method: 'get',
    params: { data }
  })
}

// 查询巡检任务发起人信息
const listSendUsers = (data) => {
  return service({
    url: root + constant.listSendUsers,
    method: 'get',
    params: { data }
  })
}

// 查询巡检任务巡检人信息
const listPatrolUsers = (data) => {
  return service({
    url: root + constant.listPatrolUsers,
    method: 'get',
    params: { data }
  })
}

// 查询逾期状态列表
const listOverdue = (data) => {
  return service({
    url: root + constant.listOverdue,
    method: 'get',
    params: { data }
  })
}

export { listPatrolTask, listPatrolTaskPoint, listSendUsers,
  listPatrolUsers, listOverdue, removePatrolTask, getLowerUserofCurrentUser, getCheckGroupAndItem }
